<template>
	<div class="index" >
    <el-table :data="tableData"  border  style="width: 100%">
        <el-table-column prop="testclass" label="考试名称"></el-table-column>
        <el-table-column prop="testsubj" label="考试科目"></el-table-column>
        <el-table-column prop="address_cn" label="考场地址"></el-table-column>
        <!-- <el-table-column prop="address_eng" label="考场地址"></el-table-column> -->
        <el-table-column prop="city" label="考场所在城市"></el-table-column>
        <!-- <el-table-column prop="testclass" label="考试等级"></el-table-column> -->
        <el-table-column prop="testtime" label="考试时间"></el-table-column>
        <el-table-column prop="siteno" label="考场号"></el-table-column>
        <el-table-column prop="chatno" label="座号"></el-table-column>
        <el-table-column prop="feestate" label="缴费状态"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <div style="color: #0872BA; cursor: pointer;" @click="dayinshow(scope.row)">打印准考证</div>
          </template>
        </el-table-column>
    </el-table>
    <dayin :item="item" ref="dayin" v-if="relo"></dayin>
	</div>
</template>

<script>
  import dayin from './dayinzhunkaozheng.vue'
	export default {
		name: 'index',
    components:{
      dayin
    },
		data() {
			return {
        tableData: [],
        item:"",
        relo:true
			}
		},
		created() {
      this.getlist()

		},
		mounted() {

		},
		methods: {
      dayinshow:function(item){
        this.item = JSON.parse(JSON.stringify(item))

        this.relo = false
        this.$nextTick(()=>{
          this.relo = true
          this.$nextTick(()=>{
            this.$refs.dayin.log = true
          })

        })
      },
      getlist:function(){
        axios.post(this.IP_URL+'/user/gettest').then((response)=>{
          if(response.data.errorcode == 0){
            this.tableData = response.data.info
          } else {
            this.$message.error(response.data.reason);
          }
        })
      }
    }
	}
</script>


<style scoped >

</style>
